\hypertarget{skpng_8c}{
\section{skpng.c File Reference}
\label{skpng_8c}\index{skpng.c@{skpng.c}}
}
{\ttfamily \#include $<$stdio.h$>$}\par
{\ttfamily \#include $<$stdlib.h$>$}\par
{\ttfamily \#include $<$errno.h$>$}\par
{\ttfamily \#include \char`\"{}skpng.h\char`\"{}}\par
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{skpng_8c_a5418f6e35750224dec6feb2fe82fb1b7}{skpng\_\-png\_\-version\_\-info} ()
\item 
\hyperlink{structskpng__image__color__layer__str}{skpng\_\-icl} \hyperlink{skpng_8c_a9b0b5bd4bff19a6b295cca7e85f1ba0e}{skpng\_\-formula\_\-alphablending} (\hyperlink{structskpng__image__color__layer__str}{skpng\_\-icl} $\ast$RGBA, \hyperlink{structskpng__image__color__layer__str}{skpng\_\-icl} $\ast$rgba, float alphafactor)
\item 
int \hyperlink{skpng_8c_a34b286669baee0d2787dd1660c7be8a1}{skpng\_\-proceed\_\-extractdiff} (\hyperlink{structskpng__image__str}{skpng\_\-image} $\ast$image1\_\-ptr, \hyperlink{structskpng__image__str}{skpng\_\-image} $\ast$image2\_\-ptr, \hyperlink{structskpng__image__str}{skpng\_\-image} $\ast$imageO\_\-ptr, float alpha\_\-percent, int bgcolor)
\item 
int \hyperlink{skpng_8c_a9059fecac5c46a920b49589f6152a6c7}{skpng\_\-proceed\_\-merge} (\hyperlink{structskpng__image__str}{skpng\_\-image} $\ast$image1\_\-ptr, \hyperlink{structskpng__image__str}{skpng\_\-image} $\ast$image2\_\-ptr, \hyperlink{structskpng__image__str}{skpng\_\-image} $\ast$imageO\_\-ptr, float alpha\_\-percent)
\item 
int \hyperlink{skpng_8c_a4c31e0b7f3a84862addc60bb51b71dd7}{skpng\_\-prepare\_\-output\_\-file} (char $\ast$filename, \hyperlink{structskpng__image__str}{skpng\_\-image} $\ast$image1)
\item 
int \hyperlink{skpng_8c_ac213bdb23f6da5bc6945fdfb93843d61}{skpng\_\-write} (char $\ast$filename, \hyperlink{structskpng__image__str}{skpng\_\-image} $\ast$image1)
\item 
int \hyperlink{skpng_8c_a25d060d9bae5091e2a37bed35abf7517}{skpng\_\-read} (char $\ast$filename, \hyperlink{structskpng__image__str}{skpng\_\-image} $\ast$image1)
\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
unsigned char \hyperlink{skpng_8c_a82067cde1d78f5d297ce3a0e657af26d}{header} \mbox{[}8\mbox{]}
\item 
int \hyperlink{skpng_8c_a4e5c1b1bef3aaad5af98436c73397964}{header\_\-size} = 8
\item 
int \hyperlink{skpng_8c_a7c026963e4ca1518d0f180b291c6d96a}{is\_\-png}
\end{DoxyCompactItemize}


\subsection{Function Documentation}
\hypertarget{skpng_8c_a9b0b5bd4bff19a6b295cca7e85f1ba0e}{
\index{skpng.c@{skpng.c}!skpng\_\-formula\_\-alphablending@{skpng\_\-formula\_\-alphablending}}
\index{skpng\_\-formula\_\-alphablending@{skpng\_\-formula\_\-alphablending}!skpng.c@{skpng.c}}
\subsubsection[{skpng\_\-formula\_\-alphablending}]{\setlength{\rightskip}{0pt plus 5cm}{\bf skpng\_\-icl} skpng\_\-formula\_\-alphablending (
\begin{DoxyParamCaption}
\item[{{\bf skpng\_\-icl} $\ast$}]{ RGBA, }
\item[{{\bf skpng\_\-icl} $\ast$}]{ rgba, }
\item[{float}]{ alphafactor}
\end{DoxyParamCaption}
)}}
\label{skpng_8c_a9b0b5bd4bff19a6b295cca7e85f1ba0e}
Compute RGBA channel to make alphablending \char`\"{}beautiful\char`\"{}


\begin{DoxyParams}{Parameters}
\item[{\em RGBA}]Chanel value of background image \item[{\em rgba}]Chanel value of foreground image \item[{\em alphafactor}]Factor of transparency \end{DoxyParams}
\begin{DoxyReturn}{Returns}

\end{DoxyReturn}
\hypertarget{skpng_8c_a5418f6e35750224dec6feb2fe82fb1b7}{
\index{skpng.c@{skpng.c}!skpng\_\-png\_\-version\_\-info@{skpng\_\-png\_\-version\_\-info}}
\index{skpng\_\-png\_\-version\_\-info@{skpng\_\-png\_\-version\_\-info}!skpng.c@{skpng.c}}
\subsubsection[{skpng\_\-png\_\-version\_\-info}]{\setlength{\rightskip}{0pt plus 5cm}void skpng\_\-png\_\-version\_\-info (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}
\label{skpng_8c_a5418f6e35750224dec6feb2fe82fb1b7}
Return current and compiled version of libpng \hypertarget{skpng_8c_a4c31e0b7f3a84862addc60bb51b71dd7}{
\index{skpng.c@{skpng.c}!skpng\_\-prepare\_\-output\_\-file@{skpng\_\-prepare\_\-output\_\-file}}
\index{skpng\_\-prepare\_\-output\_\-file@{skpng\_\-prepare\_\-output\_\-file}!skpng.c@{skpng.c}}
\subsubsection[{skpng\_\-prepare\_\-output\_\-file}]{\setlength{\rightskip}{0pt plus 5cm}int skpng\_\-prepare\_\-output\_\-file (
\begin{DoxyParamCaption}
\item[{char $\ast$}]{ filename, }
\item[{{\bf skpng\_\-image} $\ast$}]{ image1}
\end{DoxyParamCaption}
)}}
\label{skpng_8c_a4c31e0b7f3a84862addc60bb51b71dd7}
Prepare the output file from a model \char`\"{}image1\char`\"{}


\begin{DoxyParams}{Parameters}
\item[{\em filename}]Name of the output file \item[{\em image1}]Image data in skpng format \end{DoxyParams}
\begin{DoxyReturn}{Returns}

\end{DoxyReturn}
\hypertarget{skpng_8c_a34b286669baee0d2787dd1660c7be8a1}{
\index{skpng.c@{skpng.c}!skpng\_\-proceed\_\-extractdiff@{skpng\_\-proceed\_\-extractdiff}}
\index{skpng\_\-proceed\_\-extractdiff@{skpng\_\-proceed\_\-extractdiff}!skpng.c@{skpng.c}}
\subsubsection[{skpng\_\-proceed\_\-extractdiff}]{\setlength{\rightskip}{0pt plus 5cm}int skpng\_\-proceed\_\-extractdiff (
\begin{DoxyParamCaption}
\item[{{\bf skpng\_\-image} $\ast$}]{ image1\_\-ptr, }
\item[{{\bf skpng\_\-image} $\ast$}]{ image2\_\-ptr, }
\item[{{\bf skpng\_\-image} $\ast$}]{ imageO\_\-ptr, }
\item[{float}]{ alpha\_\-percent, }
\item[{int}]{ bgcolor}
\end{DoxyParamCaption}
)}}
\label{skpng_8c_a34b286669baee0d2787dd1660c7be8a1}
Extract the diff between image1 \& image2 and put it in imageO

\begin{Desc}
\item[\hyperlink{todo__todo000001}{Todo}]alphapercent and bgcolor are not used in this version \end{Desc}

\begin{DoxyParams}{Parameters}
\item[{\em image1\_\-ptr}]Image data in skpng format \item[{\em image2\_\-ptr}]Image data in skpng format \item[{\em imageO\_\-ptr}]Data of image0 in skpng format \item[{\em alpha\_\-percent}]Factor of transparency (not used) \item[{\em bgcolor}]Background color (not used) \end{DoxyParams}
\begin{DoxyReturn}{Returns}

\end{DoxyReturn}
\hypertarget{skpng_8c_a9059fecac5c46a920b49589f6152a6c7}{
\index{skpng.c@{skpng.c}!skpng\_\-proceed\_\-merge@{skpng\_\-proceed\_\-merge}}
\index{skpng\_\-proceed\_\-merge@{skpng\_\-proceed\_\-merge}!skpng.c@{skpng.c}}
\subsubsection[{skpng\_\-proceed\_\-merge}]{\setlength{\rightskip}{0pt plus 5cm}int skpng\_\-proceed\_\-merge (
\begin{DoxyParamCaption}
\item[{{\bf skpng\_\-image} $\ast$}]{ image1\_\-ptr, }
\item[{{\bf skpng\_\-image} $\ast$}]{ image2\_\-ptr, }
\item[{{\bf skpng\_\-image} $\ast$}]{ imageO\_\-ptr, }
\item[{float}]{ alpha\_\-percent}
\end{DoxyParamCaption}
)}}
\label{skpng_8c_a9059fecac5c46a920b49589f6152a6c7}
Merge two images in one. The second will apply an alphablending operation


\begin{DoxyParams}{Parameters}
\item[{\em image1\_\-ptr}]Image data in skpng format \item[{\em image2\_\-ptr}]Image data in skpng format \item[{\em imageO\_\-ptr}]Image data in skpng format \item[{\em alpha\_\-percent}]Factor of transparency (not used) \end{DoxyParams}
\begin{DoxyReturn}{Returns}

\end{DoxyReturn}
\hypertarget{skpng_8c_a25d060d9bae5091e2a37bed35abf7517}{
\index{skpng.c@{skpng.c}!skpng\_\-read@{skpng\_\-read}}
\index{skpng\_\-read@{skpng\_\-read}!skpng.c@{skpng.c}}
\subsubsection[{skpng\_\-read}]{\setlength{\rightskip}{0pt plus 5cm}int skpng\_\-read (
\begin{DoxyParamCaption}
\item[{char $\ast$}]{ filename, }
\item[{{\bf skpng\_\-image} $\ast$}]{ image1}
\end{DoxyParamCaption}
)}}
\label{skpng_8c_a25d060d9bae5091e2a37bed35abf7517}
Read a png file (RGBA only)


\begin{DoxyParams}{Parameters}
\item[{\em filename}]Name of file to read \item[{\em image1}]Image Data \end{DoxyParams}
\begin{DoxyReturn}{Returns}

\end{DoxyReturn}
\hypertarget{skpng_8c_ac213bdb23f6da5bc6945fdfb93843d61}{
\index{skpng.c@{skpng.c}!skpng\_\-write@{skpng\_\-write}}
\index{skpng\_\-write@{skpng\_\-write}!skpng.c@{skpng.c}}
\subsubsection[{skpng\_\-write}]{\setlength{\rightskip}{0pt plus 5cm}int skpng\_\-write (
\begin{DoxyParamCaption}
\item[{char $\ast$}]{ filename, }
\item[{{\bf skpng\_\-image} $\ast$}]{ image1}
\end{DoxyParamCaption}
)}}
\label{skpng_8c_ac213bdb23f6da5bc6945fdfb93843d61}
Write the png file


\begin{DoxyParams}{Parameters}
\item[{\em filename}]Name of file \item[{\em image1}]Image data \end{DoxyParams}
\begin{DoxyReturn}{Returns}

\end{DoxyReturn}


\subsection{Variable Documentation}
\hypertarget{skpng_8c_a82067cde1d78f5d297ce3a0e657af26d}{
\index{skpng.c@{skpng.c}!header@{header}}
\index{header@{header}!skpng.c@{skpng.c}}
\subsubsection[{header}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char {\bf header}\mbox{[}8\mbox{]}}}
\label{skpng_8c_a82067cde1d78f5d297ce3a0e657af26d}
\hypertarget{skpng_8c_a4e5c1b1bef3aaad5af98436c73397964}{
\index{skpng.c@{skpng.c}!header\_\-size@{header\_\-size}}
\index{header\_\-size@{header\_\-size}!skpng.c@{skpng.c}}
\subsubsection[{header\_\-size}]{\setlength{\rightskip}{0pt plus 5cm}int {\bf header\_\-size} = 8}}
\label{skpng_8c_a4e5c1b1bef3aaad5af98436c73397964}
\hypertarget{skpng_8c_a7c026963e4ca1518d0f180b291c6d96a}{
\index{skpng.c@{skpng.c}!is\_\-png@{is\_\-png}}
\index{is\_\-png@{is\_\-png}!skpng.c@{skpng.c}}
\subsubsection[{is\_\-png}]{\setlength{\rightskip}{0pt plus 5cm}int {\bf is\_\-png}}}
\label{skpng_8c_a7c026963e4ca1518d0f180b291c6d96a}
